2000 |
How can I change the visual appearance of the filter bar's close button (solid)
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptVisible := EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible; set_Background(EXG2ANTTLib.BackgroundPartEnum.exFooterFilterBarButton,$ff); EndUpdate(); end |
1999 |
Is it possible to prevent definitely showing the filter bar's close button
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptVisible := EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible; set_Background(EXG2ANTTLib.BackgroundPartEnum.exFooterFilterBarButton,$ffffffff); EndUpdate(); end |
1998 |
Is it possible to show the close button only if there is a filter applied
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptVisible := Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarShowCloseIfRequired) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible); EndUpdate(); end |
1997 |
The control's filter bar is not closed once I click the close button (toggle)
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); LockedItemCount[EXG2ANTTLib.VAlignmentEnum.exBottom] := 1; h := LockedItem[EXG2ANTTLib.VAlignmentEnum.exBottom,0]; ItemDivider[h] := 0; CellValue[TObject(h),TObject(0)] := '<c><fgcolor=808080>Press the CTRL + F to turn on/off the control''s filter bar. ALT + Up/Down moves the focus.'; CellValueFormat[TObject(h),TObject(0)] := EXG2ANTTLib.ValueFormatEnum.exHTML; end; FilterBarCaption := '`<r><fgcolor=808080>` + value'; FilterBarPromptPattern := 'B'; FilterBarPromptVisible := Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarCompact) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarToggle) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarSingleLine) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarVisible) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible); with Columns.Item[TObject(0)] do begin FilterType := EXG2ANTTLib.FilterTypeEnum.exFilter; Filter := 'Item B'; end; ApplyFilter(); EndUpdate(); end |
1996 |
How can I display the control's filter on a single line
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarCaption := 'len(value) ? `filter for: <fgcolor 808080>` + value : `<fgcolor 808080>no filter`'; FilterBarPromptVisible := Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarSingleLine) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarVisible); with Columns.Item[TObject(0)] do begin FilterType := EXG2ANTTLib.FilterTypeEnum.exFilter; Filter := 'Item A|Item B'; end; ApplyFilter(); EndUpdate(); end |
1995 |
How can I display the control's filter on a single line (prompt-combined)
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarCaption := '`<r>` + value'; FilterBarPromptVisible := Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarCompact) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarSingleLine) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarVisible) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible); with Columns.Item[TObject(0)] do begin FilterType := EXG2ANTTLib.FilterTypeEnum.exFilter; Filter := 'Item A|Item B'; end; ApplyFilter(); EndUpdate(); end |
1994 |
How can I get the number of results after a filter is applied
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; // Click event - Occurs when the user presses and then releases the left mouse button over the tree control. procedure TWinForm1.AxG2antt1_ClickEvent(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin ClearFilter(); end end; // FilterChange event - Occurs when the filter was changed. procedure TWinForm1.AxG2antt1_FilterChange(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin OutputDebugString( 'Items.MatchItemCount' ); OutputDebugString( Items.MatchItemCount ); OutputDebugString( FormatABC('value < 0 ? `filter applied: ` + abs(value + 1) + ` result(s)` : `no filter`',Items.MatchItemCount,Nil,Nil) ); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptVisible := EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible; FilterBarPromptPattern := 'Item'; EndUpdate(); end |
1993 |
How can I programmatically clear the control's filter
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; // Click event - Occurs when the user presses and then releases the left mouse button over the tree control. procedure TWinForm1.AxG2antt1_ClickEvent(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin ClearFilter(); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptVisible := EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible; FilterBarPromptPattern := 'B'; EndUpdate(); end |
1992 |
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt-combined)
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptPattern := 'B'; FilterBarPromptVisible := Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarVisible) Or Integer(EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible); with Columns.Item[TObject(0)] do begin FilterType := EXG2ANTTLib.FilterTypeEnum.exFilter; Filter := 'Item B'; end; ApplyFilter(); EndUpdate(); end |
1991 |
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt)
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarPromptVisible := EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarPromptVisible; FilterBarPromptPattern := 'B'; EndUpdate(); end |
1990 |
Is it possible to prevent closing the control's filter bar, so it is always shown
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin Items.AddBar(e.item,'Task','12/4/2017','12/14/2017',Nil,Nil); end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/2/2017'; PaneWidth[False] := 256; end; (Columns.Add('Item') as EXG2ANTTLib.Column).DisplayFilterButton := True; with (Columns.Add('Pos') as EXG2ANTTLib.Column) do begin AllowSizing := False; AllowSort := False; Width := 32; FormatColumn := '1 apos ``'; Position := 0; end; with Items do begin AddItem('Item A'); AddItem('Item B'); AddItem('Item C'); end; FilterBarCaption := 'len(value) = 0 ? `<fgcolor=808080>no filter` : value'; FilterBarPromptVisible := EXG2ANTTLib.FilterBarVisibleEnum.exFilterBarVisible; with Columns.Item[TObject(0)] do begin FilterType := EXG2ANTTLib.FilterTypeEnum.exFilter; Filter := 'Item B'; end; ApplyFilter(); EndUpdate(); end |
1989 |
What are the options to align the percent caption
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Clip'); ScrollBySingleLine := True; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exRowLines; with Chart do begin AllowResizeChart := Integer(EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartHeader); DrawGridLines := EXG2ANTTLib.GridLinesEnum.exRowLines; FirstVisibleDate := '12/26/2000'; LevelCount := 2; PaneWidth[False] := 256; with Bars.Add('Task%Progress') do begin Shortcut := 'Task'; Pattern := EXG2ANTTLib.PatternEnum.exPatternBox; Color := $a4a4a4; StartColor := $f0f0f0; EndColor := StartColor; OverlaidType := Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsIncludeCaption) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack); Height := 15; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercent] := TObject(0.5); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarShowPercentCaption] := TObject(True); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercentCaptionFormat] := '<sha ;;0>%p%'; end; end; with Items do begin h := AddItem('no clip, (0-2)'); AddBar(h,'Task','1/2/2001','1/4/2001','K1',Nil); ItemBar[h,'K1',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(2); AddBar(h,'Task','1/2/2001','1/4/2001','K2',Nil); ItemBar[h,'K2',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(1); AddBar(h,'Task','1/2/2001','1/4/2001','K3',Nil); ItemBar[h,'K3',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(0); h := AddItem('clip, inside (3-5)'); AddBar(h,'Task','1/2/2001','1/4/2001','K1',Nil); ItemBar[h,'K1',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(5); AddBar(h,'Task','1/2/2001','1/4/2001','K2',Nil); ItemBar[h,'K2',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(4); AddBar(h,'Task','1/2/2001','1/4/2001','K3',Nil); ItemBar[h,'K3',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(3); h := AddItem('hide on min width, clip if not fit, inside (6-8)'); AddBar(h,'Task','1/2/2001','1/4/2001','K1',Nil); ItemBar[h,'K1',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(8); AddBar(h,'Task','1/2/2001','1/4/2001','K2',Nil); ItemBar[h,'K2',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(7); AddBar(h,'Task','1/2/2001','1/4/2001','K3',Nil); ItemBar[h,'K3',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(6); h := AddItem('hide if not fit, no clip, inside (9-11)'); AddBar(h,'Task','1/2/2001','1/4/2001','K1',Nil); ItemBar[h,'K1',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(11); AddBar(h,'Task','1/2/2001','1/4/2001','K2',Nil); ItemBar[h,'K2',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(10); AddBar(h,'Task','1/2/2001','1/4/2001','K3',Nil); ItemBar[h,'K3',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(9); h := AddItem('no clip, inside, outside (12-14)'); AddBar(h,'Task','1/2/2001','1/4/2001','K1',Nil); ItemBar[h,'K1',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(14); AddBar(h,'Task','1/2/2001','1/4/2001','K2',Nil); ItemBar[h,'K2',EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(13); AddBar(h,'Task','1/2/2001','1/4/2001','K3',Nil); ItemBar[h,'K3',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(12); h := AddItem('no clip, outside (16-18)'); AddBar(h,'Task','1/2/2001','1/4/2001','K1',Nil); ItemBar[h,'K1',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(18); AddBar(h,'Task','1/2/2001','1/4/2001','K2',Nil); ItemBar[h,'K2',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(17); AddBar(h,'Task','1/2/2001','1/4/2001','K3',Nil); ItemBar[h,'K3',EXG2ANTTLib.ItemBarPropertyEnum.exBarAlignPercentCaption] := TObject(16); end; EndUpdate(); end |
1988 |
Is it possible to determine whether a bar is in the current display area
// BarResizing event - Occurs when a bar is moving or resizing. procedure TWinForm1.AxG2antt1_BarResizing(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent); begin with AxG2antt1 do begin Refresh(); end end; // DateChange event - Occurs when the first visible date is changed. procedure TWinForm1.AxG2antt1_DateChange(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin Refresh(); end end; // FormatColumn event - Fired when a cell requires to format its caption. procedure TWinForm1.AxG2antt1_FormatColumn(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_FormatColumnEvent); begin with AxG2antt1 do begin s := Items.ItemBar[e.item,'A',EXG2ANTTLib.ItemBarPropertyEnum.exBarStart]; e := Items.ItemBar[e.item,'A',EXG2ANTTLib.ItemBarPropertyEnum.exBarEnd]; l := FormatABC('A < B',TObject(e),Chart.FirstVisibleDate,Nil); r := FormatABC('A > B',TObject(s),Chart.DateFromPoint[1,-1],Nil); e.value := FormatABC('( A or B ) ? `<fgcolor=C0C0C0>hidden` : `<b>visible`',TObject(l),TObject(r),Nil); end end; // LayoutChanged event - Occurs when column's position or column's size is changed. procedure TWinForm1.AxG2antt1_LayoutChanged(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin Refresh(); end end; with AxG2antt1 do begin BeginUpdate(); SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; Columns.Add('Tasks'); with (Columns.Add('Visible') as EXG2ANTTLib.Column) do begin FireFormatColumn := True; Def[EXG2ANTTLib.DefColumnEnum.exCellValueFormat] := TObject(1); end; with Chart do begin OverviewVisible := EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAll; OverviewHeight := 64; FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; SelBackColor := BackColor; SelForeColor := ForeColor; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/8/2017','A',Nil); AddBar(AddItem('Task 2'),'Task','8/3/2018','8/10/2018','A',Nil); AddBar(AddItem('Task 3'),'Task','8/4/2019','8/12/2019','A',Nil); SelectItem[FocusItem] := True; end; EndUpdate(); end |
1987 |
How can I ensure that the bar fits the control's client area
// SelectionChanged event - Fired after a new item has been selected. procedure TWinForm1.AxG2antt1_SelectionChanged(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin h := Items.FocusItem; k := Items.FirstItemBar[h]; s := FormatABC('(A+B)/2',Items.ItemBar[h,TObject(k),EXG2ANTTLib.ItemBarPropertyEnum.exBarStart],Items.ItemBar[h,TObject(k),EXG2ANTTLib.ItemBarPropertyEnum.exBarEnd],Nil); Chart.ScrollTo(s,TObject(1)); end end; with AxG2antt1 do begin BeginUpdate(); SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/8/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2018','8/10/2018',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2019','8/12/2019',Nil,Nil); SelectItem[FocusItem] := True; end; EndUpdate(); end |
1986 |
Is it possible to change the caption from a column without to remove the column and add it with the new caption
with AxG2antt1 do begin (Columns.Add('ColumnName') as EXG2ANTTLib.Column).Caption := 'NewName'; (Columns.Add('ColumnName') as EXG2ANTTLib.Column).HTMLCaption := '<b>New</b>Name'; end |
1985 |
How can I display the bar's duration in days, minutes, and so so on
with AxG2antt1 do begin BeginUpdate(); with Columns do begin (Add('Tasks') as EXG2ANTTLib.Column).AllowSizing := False; with (Add('Duration') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(513); Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarKey] := 'A'; FormatColumn := 'trim((1:=int((0:=value)/365) ? =:1 + ` year(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*365)))/31) ? =:1 + ` month(s) ` : ``) + (1:=in' + 't((0:=(=:0 - (=:1*31)))/7) ? =:1 + ` week(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*7)))/1) ? =:1 + ` day(s) ` : ``) + (1:=int((0:=(=' + ':0 - =:1 + 1/24/60/60/2))*24) ? =:1 + ` hour(s) ` : ``) + (1:=int((0:=(=:0*24 - =:1))*60) ? =:1 + ` min(s) ` : ``) + (1:=int((0:' + '=(=:0*60 - =:1))*60) ? =:1 + ` sec(s)` : ``))'; end; end; Items.AllowCellValueToItemBar := True; with Chart do begin FirstVisibleDate := '12/30/2001'; LevelCount := 2; PaneWidth[False] := 196; Bars.Add('Task:Split').Shortcut := 'Task'; OverviewVisible := EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAll; OverviewHeight := 64; ResizeUnitScale := EXG2ANTTLib.UnitEnum.exSecond; AllowResizeChart := Integer(EXG2ANTTLib.ResizeChartEnum.exAllowChangeUnitScale) Or Integer(EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartHeader); end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','12/31/2001','1/7/2002','A',Nil); h := AddItem('Task 2'); AddBar(h,'Task','1/1/2002','2/14/2002','A',Nil); h := AddItem('Task 3'); AddBar(h,'Task','1/2/2002 10:00:00 AM','1/2/2002 12:00:00 PM','A',Nil); h := AddItem('Task 4'); AddBar(h,'Task','1/3/2002','1/4/2002 8:30:30 AM','A',Nil); end; EndUpdate(); end |
1984 |
How can I change the background color for checked items (EBN color, frame)
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin Refresh(); end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; DefaultItemHeight := 22; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with VisualAppearance do begin Add(2,'gBFLBCJwBAEHhEJAAEhABUkIQAAYAQGKIcBiAKBQAGYBIJDEMQ3DjAUBjMK4ZwTC4AIQjCK4JDKHYJRpHEZgLBMJAAGIZYhhUYRUiYMkiJBGGDIDiGGI2SJAcbTVIEcx' + '9EyUJSgSTJOjCMokTTIU4TTLYASbJafJJhWSaAiyMouDIOMg1BDNIw/Hika6jOgKUisNJXRzWIBTbDlOQ3JqnbCjOQRSrQBoNDAMAiiaKlbwJPK9RoieQXfwUAJrXJcF' + 'qXFSLVxNBKAQEBA='); Add(1,'CP:2 1 1 -1 -1'); end; with ConditionalFormats.Add('%CS0 = 1',Nil) do begin BackColor := $1000000; ChartBackColor := BackColor; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1983 |
How can I change the caption of the checked items (sample 2)
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; SelBackColor := BackColor; SelForeColor := ForeColor; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; Def[EXG2ANTTLib.DefColumnEnum.exCellValueFormat] := TObject(1); FormatColumn := '%CS0 = 1 ? `<bgcolor=000000><fgcolor=FFFFFF> ` + value + ` </fgcolor></bgcolor>` : value'; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 256; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1982 |
How can I change the caption of the checked items (sample 1)
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; Def[EXG2ANTTLib.DefColumnEnum.exCellValueFormat] := TObject(1); FormatColumn := 'value + (%CS0 = 1 ? `<r><fgcolor=808080>(checked)` : ``)'; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 256; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1981 |
How can I change the font for the checked items
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin Refresh(); end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; DefaultItemHeight := 22; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with ConditionalFormats.Add('%CS0 = 1',Nil) do begin f := (ComObj.CreateComObject(ComObj.ProgIDToClassID('StdFont')) as stdole.StdFont); with f do begin Name := AxG2antt1.Font.Name; Size := 12; end; Font := (f as stdole.StdFont); end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 196; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1980 |
How can I bold the checked items
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin Refresh(); end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with ConditionalFormats.Add('%CS0 = 1',Nil) do begin Bold := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1979 |
How can I change the foreground color for checked items
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin Refresh(); end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with ConditionalFormats.Add('%CS0 = 1',Nil) do begin ForeColor := $8080ff; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1978 |
How can I change the background color for checked items (solid color)
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin Refresh(); end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with ConditionalFormats.Add('%CS0 = 1',Nil) do begin BackColor := $8080ff; ChartBackColor := BackColor; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1977 |
How can I change the color for checked Task bars
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with ConditionalFormats.Add('%CS0 = 1',Nil) do begin ApplyToBars := 'Task,Summary'; BarColor := $ff; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1976 |
I have defined "NonWorkingHours" for the Gantt, and the "exBarWorkingCount" properly excludes these hours as long as the Gantt is using "exDay" or "exHour" as the level unit. However when displaying a quarter or a year, I'm changing the unit to "exWeek", but then the "NonWorkingHours" are no longer excluded from the bars "exBarWorkingCount" and displays the wrong value
with AxG2antt1 do begin BeginUpdate(); with Columns do begin (Add('Tasks') as EXG2ANTTLib.Column).AllowSizing := False; with (Add('Working') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(258); Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarKey] := 'A'; FormatColumn := '((1:=int(0:=( 24*int(value) + (value - int(value) + 1/24/60/60/2)*24))) != 0 ? =:1 + '' hour(s)'' : '''' ) + (=:1 ? '' '' : '''' ) + ((1' + ':=round((=:0 - =:1)*60)) != 0 ? =:1 + '' min(s)'' : '''')'; end; end; Items.AllowCellValueToItemBar := True; with Chart do begin AllowResizeChart := Integer(EXG2ANTTLib.ResizeChartEnum.exAllowChangeUnitScale) Or Integer(EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartHeader); PaneWidth[False] := 196; Bars.Add('Task:Split').Shortcut := 'Task'; FirstVisibleDate := '1/3/2002'; LevelCount := 2; Level[0].Label := '<%ddd%>'; Level[1].Label := '<%hh%>'; NonworkingHours := 16761855; ShowNonworkingUnits := False; ShowNonworkingUnits := False; OverviewVisible := EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAll; OverviewHeight := 64; AllowOverviewZoom := EXG2ANTTLib.OverviewZoomEnum.exAlwaysZoom; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/4/2002','1/8/2002','A',Nil); ItemBar[h,'A',EXG2ANTTLib.ItemBarPropertyEnum.exBarKeepWorkingCount] := TObject(True); h := AddItem('Task 2'); AddBar(h,'Task','1/3/2002','1/4/2002','A',Nil); ItemBar[h,'A',EXG2ANTTLib.ItemBarPropertyEnum.exBarKeepWorkingCount] := TObject(True); end; with Chart do begin UnitScale := EXG2ANTTLib.UnitEnum.exDay; ScrollTo(FirstVisibleDate,TObject(1)); end; EndUpdate(); end |
1975 |
Is it possible to customize the editor selection colour of the built in text editor, from standard blue to black
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; SelBackColor := Color.FromArgb(0,0,0); SelForeColor := Color.FromArgb(255,255,255); Chart.PaneWidth[True] := 0; with (Columns.Add('Edit') as EXG2ANTTLib.Column).Editor do begin EditType := EXG2ANTTLib.EditTypeEnum.MaskType; Mask := ';;;rich'; end; with Items do begin AddItem(''); AddItem('Just a text'); AddItem(''); end; EndUpdate(); end |
1974 |
Is it possible to customize the editor selection colour of the built in dropdown editor, from standard blue to black
with AxG2antt1 do begin BeginUpdate(); SelBackColor := Color.FromArgb(0,0,0); SelForeColor := Color.FromArgb(255,255,255); Chart.PaneWidth[True] := 0; with (Columns.Add('DropDown') as EXG2ANTTLib.Column).Editor do begin AddItem(1,'This is just the first item',Nil); AddItem(2,'This is just the second item',Nil); AddItem(3,'This is just the third item',Nil); EditType := EXG2ANTTLib.EditTypeEnum.DropDownType; Mask := ';;;rich'; end; with Items do begin AddItem(''); AddItem('Just a text'); AddItem(''); end; EndUpdate(); end |
1973 |
When I display the chart in the daily view, the histogram shows correctly the data while if the chart displays the data in weekly or monthly view, the histogram shows no data or incorrectly. What can be the problem
// OverviewZoom event - Occurs once the user selects a new time scale unit in the overview zoom area. procedure TWinForm1.AxG2antt1_OverviewZoom(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin Chart.ResizeUnitScale := EXG2ANTTLib.UnitEnum.exDay; end end; with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with (Columns.Add('Effort') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(21); Editor.EditType := EXG2ANTTLib.EditTypeEnum.SpinType; end; with Chart do begin AllowOverviewZoom := EXG2ANTTLib.OverviewZoomEnum.exAlwaysZoom; OverviewZoomCaption := '|||<img>3</img>Month|Third|<img>2</img>Week|<img>1</img>Day|||'; Label[EXG2ANTTLib.UnitEnum.exYear] := ''; Label[EXG2ANTTLib.UnitEnum.exHalfYear] := ''; Label[EXG2ANTTLib.UnitEnum.exQuarterYear] := ''; Label[EXG2ANTTLib.UnitEnum.exThirdMonth] := ''; Label[EXG2ANTTLib.UnitEnum.exHour] := ''; Label[EXG2ANTTLib.UnitEnum.exMinute] := ''; Label[EXG2ANTTLib.UnitEnum.exSecond] := ''; OverviewZoomUnit := 64; LevelCount := 2; NonworkingDays := 0; PaneWidth[False] := 96; FirstVisibleDate := '6/20/2005'; HistogramVisible := True; HistogramHeight := 128; HistogramView := EXG2ANTTLib.HistogramViewEnum.exHistogramAllItems; OverviewVisible := EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAll; with Bars.Item['Task'] do begin HistogramPattern := Pattern; HistogramType := EXG2ANTTLib.HistogramTypeEnum.exHistOverload; HistogramCriticalValue := 3; HistogramItems := -7; HistogramGridLinesColor := $c0c0c0; HistogramRulerLinesColor := $10000; end; end; with Items do begin AllowCellValueToItemBar := True; h1 := AddItem('Task 1'); AddBar(h1,'Task','6/21/2005','6/23/2005',Nil,Nil); CellValue[TObject(h1),TObject(1)] := TObject(4); h1 := AddItem('Task 2'); AddBar(h1,'Task','6/24/2005','6/26/2005',Nil,Nil); CellValue[TObject(h1),TObject(1)] := TObject(3); h1 := AddItem('Task 3'); AddBar(h1,'Task','6/27/2005','6/29/2005',Nil,Nil); CellValue[TObject(h1),TObject(1)] := TObject(2); h1 := AddItem('Task 4'); AddBar(h1,'Task','6/30/2005','7/2/2005',Nil,Nil); CellValue[TObject(h1),TObject(1)] := TObject(1); end; EndUpdate(); end |
1972 |
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). procedure TWinForm1.AxG2antt1_BeforeExpandItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_BeforeExpandItemEvent); begin with AxG2antt1 do begin OutputDebugString( 'BeforeExpandItem' ); OutputDebugString( e.item ); OutputDebugString( 'ColumnFromPoint' ); OutputDebugString( get_ColumnFromPoint(-1,-1) ); OutputDebugString( 'ColumnFromPoint return -1, if the user clicks the +/- glitch, else it returns the index of the column where the click occurs.' ); Items.InsertItem(e.item,Nil,'new child'); end end; with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with Columns do begin (Add('Items') as EXG2ANTTLib.Column).DisplayFilterButton := True; end; with Items do begin ItemHasChildren[InsertItem(Nil,Nil,'Group 1')] := True; ItemHasChildren[InsertItem(Nil,Nil,'Group 2')] := True; end; EndUpdate(); end |
1971 |
How do I change the drop down filter icon/button (black)
with AxG2antt1 do begin BeginUpdate(); with VisualAppearance do begin Add(1,'gBFLBCJwBAEHhEJAAEhABXUIQAAYAQGKIcBiAKBQAGYBIJDEMgzDDAUBjKKocQTC4AIQjCK4JDKHYJRpHEZyCA8EhqGASRAFUQBYiWE4oSpLABQaK0ZwIGyRIrkGQgQg' + 'mPYDSDNU4zVIEEglBI0TDNczhNDENgtGYaJqHIYpZBcM40TKkEZoSIITZcRrOEBiRL1S0RBhGcRUHZlWzdN64LhuK47UrWdD/XhdVzXRbjfz1Oq+bxve48Br7A5yYThd' + 'r4LhOFQ3RjIL4xbIcUwGe6VZhjOLZXjmO49T69HTtOCYBEBA'); end; set_Background(EXG2ANTTLib.BackgroundPartEnum.exCursorHoverColumn,$ffffffff); set_Background(EXG2ANTTLib.BackgroundPartEnum.exHeaderFilterBarButton,$1000000); set_Background(EXG2ANTTLib.BackgroundPartEnum.exBackColorFilter,$10000); set_Background(EXG2ANTTLib.BackgroundPartEnum.exForeColorFilter,$ffffff); set_Description(EXG2ANTTLib.DescriptionTypeEnum.exFilterBarExclude,'<bgcolor 0><fgcolor ffffff> Exclude </fgcolor></bgcolor>'); HeaderAppearance := EXG2ANTTLib.AppearanceEnum.None2; BackColorHeader := Color.FromArgb(0,0,0); ForeColorHeader := Color.FromArgb(255,255,255); HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisible; BackColorLevelHeader := BackColor; with (Columns.Add('Filter') as EXG2ANTTLib.Column) do begin FilterList := Integer(EXG2ANTTLib.FilterListEnum.exShowExclude) Or Integer(EXG2ANTTLib.FilterListEnum.exShowCheckBox); DisplayFilterButton := True; AllowSort := False; AllowDragging := False; end; with Chart do begin PaneWidth[False] := 196; LevelCount := 2; BackColorLevelHeader := AxG2antt1.BackColorHeader; ForeColorLevelHeader := AxG2antt1.ForeColorHeader; end; with Items do begin AddItem('One'); AddItem('Two'); AddItem('Three'); end; EndUpdate(); end |
1970 |
How do I change the z-order of the bars (percent)
// MouseMove event - Occurs when the user moves the mouse. procedure TWinForm1.AxG2antt1_MouseMoveEvent(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_MouseMoveEvent); begin with AxG2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := get_ItemFromPoint(-1,-1,c,hit); OutputDebugString( Items.ItemBar[i,TObject(b),EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] ); end end; with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); DefaultItemHeight := 52; with Chart do begin LevelCount := 2; FirstVisibleDate := '10/10/2017'; PaneWidth[False] := 0; NonworkingDays := 0; MarkTodayColor := BackColor; Bars.Add('Task%Progress').Shortcut := 'Task'; with Bars.Copy('Task','T1') do begin Color := $ff; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercent] := TObject(0.25); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercentColor] := TObject(Color); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarOffset] := TObject(10); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarShowPercentCaption] := TObject(True); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercentCaptionFormat] := '<font ;6><b>%p%</b>'; end; with Bars.Copy('Task','T2') do begin Height := 26; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarVAlignCaption] := TObject(16); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercent] := TObject(0.25); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercentColor] := TObject(Color); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarShowPercentCaption] := TObject(True); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarPercentCaptionFormat] := '<font ;6><b>%p%</b>'; end; end; with Items do begin h1 := AddItem('Task'); AddBar(h1,'T1','10/15/2017','10/25/2017','2',Nil); ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar A'; ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar A <b>Over</b> Bar B'; AddBar(h1,'T2','10/18/2017','10/22/2017','1',Nil); ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar B'; ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar B <b>Under</b> Bar A'; h1 := AddItem('Task'); AddBar(h1,'T1','10/15/2017','10/25/2017','1',Nil); ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar A'; ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar A <b>Under</b> Bar B'; AddBar(h1,'T2','10/18/2017','10/22/2017','2',Nil); ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar B'; ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar B <b>Over</b> Bar A'; end; EndUpdate(); end |
1969 |
How do I change the z-order of the bars
// MouseMove event - Occurs when the user moves the mouse. procedure TWinForm1.AxG2antt1_MouseMoveEvent(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_MouseMoveEvent); begin with AxG2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := get_ItemFromPoint(-1,-1,c,hit); OutputDebugString( Items.ItemBar[i,TObject(b),EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] ); end end; with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); DefaultItemHeight := 52; with Chart do begin LevelCount := 2; FirstVisibleDate := '10/10/2017'; PaneWidth[False] := 0; NonworkingDays := 0; MarkTodayColor := BackColor; with Bars.Copy('Task','T1') do begin Color := $ff; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); end; with Bars.Copy('Task','T2') do begin Height := 25; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarVAlignCaption] := TObject(16); end; end; with Items do begin h1 := AddItem('Task'); AddBar(h1,'T1','10/15/2017','10/25/2017','2',Nil); ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar A'; ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar A <b>Over</b> Bar B'; AddBar(h1,'T2','10/18/2017','10/22/2017','1',Nil); ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar B'; ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar B <b>Under</b> Bar A'; h1 := AddItem('Task'); AddBar(h1,'T1','10/15/2017','10/25/2017','1',Nil); ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar A'; ItemBar[h1,'1',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar A <b>Under</b> Bar B'; AddBar(h1,'T2','10/18/2017','10/22/2017','2',Nil); ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarData] := 'Bar B'; ItemBar[h1,'2',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Bar B <b>Over</b> Bar A'; end; EndUpdate(); end |
1968 |
How do I get the duration/working count of the bar (sample 6,excrd)
with AxG2antt1 do begin BeginUpdate(); DefaultItemHeight := 48; ShowFocusRect := False; SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; BackColorLevelHeader := BackColor; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exAllLines; with Chart do begin DrawGridLines := EXG2ANTTLib.GridLinesEnum.exHLines; PaneWidth[False] := 64; LevelCount := 2; FirstVisibleDate := '12/26/2001'; with Bars.Add('Task:Split') do begin Shortcut := 'Task'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := '<%=%263%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarOffset] := TObject(-12); end; ColumnsFormatLevel := '1,2/3'; end; Columns.Add('Tasks'); with (Columns.Add('Duration') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(513); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.LeftAlignment; FormatColumn := 'value + `d`'; end; with (Columns.Add('Working') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(258); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.RightAlignment; FormatColumn := 'value + `w`'; end; with (Columns.Add('Working-Period') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(263); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.CenterAlignment; FormatColumn := '((value replace `\r\n` with `,`) replace `#` with ``) replace ` ` with ``'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/2/2002','1/11/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/3/2002','1/15/2002',Nil,Nil); AddBar(AddItem('Task 3'),'Task','12/31/2001','1/13/2002',Nil,Nil); end; EndUpdate(); end |
1967 |
How do I get the duration/working count of the bar (sample 5)
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TWinForm1.AxG2antt1_AddItem(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_AddItemEvent); begin with AxG2antt1 do begin with Items do begin ItemMaxHeight[e.item] := 64; end; end end; with AxG2antt1 do begin BeginUpdate(); BackColorAlternate := Color.FromArgb(240,240,240); with Chart do begin PaneWidth[False] := 256; LevelCount := 2; FirstVisibleDate := '1/1/2002'; with Bars.Add('Task:Split') do begin Shortcut := 'Task'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := '<%=%263%>'; end; ColumnsFormatLevel := '1,2'; SelBackColor := AxG2antt1.SelBackColor; end; with (Columns.Add('Task') as EXG2ANTTLib.Column) do begin AllowSizing := False; Width := 48; end; with (Columns.Add('Duration') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(513); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.LeftAlignment; end; with (Columns.Add('Working') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(258); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.RightAlignment; end; with (Columns.Add('Working-Period') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(263); Def[EXG2ANTTLib.DefColumnEnum.exCellSingleLine] := TObject(False); end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/2/2002','1/12/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/3/2002','1/15/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/4/2002','1/16/2002',Nil,Nil); end; EndUpdate(); end |
1966 |
How do I get the duration/working count of the bar (sample 4)
with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 64; LevelCount := 2; FirstVisibleDate := '12/26/2001'; Bars.Add('Task:Split').Shortcut := 'Task'; ColumnsFormatLevel := '1,2'; end; (Columns.Add('Task') as EXG2ANTTLib.Column).Width := 48; with (Columns.Add('Duration') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(513); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.LeftAlignment; FormatColumn := 'value + `d`'; end; with (Columns.Add('Working') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(258); Visible := False; Alignment := EXG2ANTTLib.AlignmentEnum.RightAlignment; FormatColumn := 'value + `w`'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/2/2002','1/12/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/3/2002','1/15/2002',Nil,Nil); end; EndUpdate(); end |
1965 |
How do I get the duration/working count of the bar (sample 3)
// BarResizing event - Occurs when a bar is moving or resizing. procedure TWinForm1.AxG2antt1_BarResizing(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent); begin with AxG2antt1 do begin with Items do begin OutputDebugString( CellCaption[TObject(e.item),TObject(0)] ); OutputDebugString( 'Working' ); OutputDebugString( ItemBar[e.item,TObject(e.key),EXG2ANTTLib.ItemBarPropertyEnum.exBarWorkingCount] ); OutputDebugString( CellCaption[TObject(e.item),TObject(0)] ); OutputDebugString( 'Duration' ); OutputDebugString( ItemBar[e.item,TObject(e.key),EXG2ANTTLib.ItemBarPropertyEnum.exBarDuration] ); end; end end; with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 64; LevelCount := 2; FirstVisibleDate := '12/26/2001'; Bars.Add('Task:Split').Shortcut := 'Task'; end; (Columns.Add('Task') as EXG2ANTTLib.Column).Width := 48; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2002','1/12/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/3/2002','1/15/2002',Nil,Nil); end; EndUpdate(); end |
1964 |
How do I get the duration/working count of the bar (sample 2)
with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 64; LevelCount := 2; FirstVisibleDate := '12/26/2001'; with Bars.Add('Task:Split') do begin Shortcut := 'Task'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<%=%258%>w'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarExtraCaption] := '<%=%513%>d'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarExtraCaptionHAlign] := TObject(16); end; end; (Columns.Add('Task') as EXG2ANTTLib.Column).Width := 48; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2002','1/12/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/3/2002','1/15/2002',Nil,Nil); end; EndUpdate(); end |
1963 |
How do I get the duration/working count of the bar (sample 1)
with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 196; LevelCount := 2; FirstVisibleDate := '1/1/2002'; Bars.Add('Task:Split').Shortcut := 'Task'; end; (Columns.Add('Task') as EXG2ANTTLib.Column).Width := 48; (Columns.Add('Duration') as EXG2ANTTLib.Column).Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(513); (Columns.Add('Working') as EXG2ANTTLib.Column).Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(258); with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/2/2002','1/12/2002',Nil,Nil); AddBar(AddItem('Task 2'),'Task','1/3/2002','1/15/2002',Nil,Nil); end; EndUpdate(); end |
1962 |
How can I draw a solid frame around the the focusing item
with AxG2antt1 do begin BeginUpdate(); SingleSel := False; DefaultItemHeight := 20; with VisualAppearance do begin RenderType := -1; Add(1,'gBFLBCJwBAEHhEJAAEhABOkGACAADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBKUQSDqEYyjGLIXAWCYSAAMIwDKAUEwpFAZBhgeDYMiSNoYDJCM4wHI' + 'URRJFCUJSGWQpTgSIgyT5HFIxXKoASbJabZLhWS6EpWOotTbIQQRYCkEyfKKfZyGURZQqOKA1DBZErWTJESRFJqLazgO4LAhyQYrVgAErzVKVCRNOqbJzADApdpGQJTU' + 'LDNTQHRFIyhOSnIRrWbMAhid6JUZiVT4dBOIYhSYANAqCwLFqrDJmWrpV5WZjlZ47V6BdAyXJsIrmFJEXaOGhyDDlGybSDZYryfZhUziUw4XjbWwZDqPF6DKTTdSGLRE' + 'E8WZVlURZvDaep3C+AY8kAYRgGCCBJECUhjDoHROEYWgoAGTQ1CEEx9lGMY0CQUYSnuZQDBGBYFlOH5+H+igGAKAJgEgFgGgGVgDn4CoCmCSA2A6A5hAgDgQgSYRIE4E' + 'oFGGCBiBeBhhkgPgbgcYgICoH4IGGWIOCSBhiGiHgVgoYooFoAoLGIWI+DCCgjCiTgrgII4ImYOoOmOSJ2AYOpWlQDQBICA='); end; ShowFocusRect := True; set_Background(EXG2ANTTLib.BackgroundPartEnum.exShowFocusRect,$1000000); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; Chart.PaneWidth[True] := 1; with (Columns.Add('P1') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with Items do begin h := AddItem('Root'); InsertItem(h,Nil,'Child 1'); InsertItem(h,Nil,'Child 2'); ExpandItem[h] := True; end; EndUpdate(); end |
1961 |
The frame around the focusing item is not very clear. Can I show it larger or more cleared (sample 2)
with AxG2antt1 do begin BeginUpdate(); SingleSel := False; DefaultItemHeight := 20; ShowFocusRect := True; with VisualAppearance do begin RenderType := -1; Add(2,'gBFLBCJwBAEHhEJAAEhABPEGACAADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBKUQSDqEYyjGLIXAWCYSAAMIwDKAUEwpFAZBhgeCRUgyJI3RgMUIzVA' + 'cRRFEiUJQlIZZCjOAw0SIMU7xZRcNxsACnaZnCR4NiuRYiUhOcqzRIQIQ4CiEahqOgJbDUJYwWZKAyjBY8XTZFCSJCpeJ6egOc5jRxQUp1WAEXx3GSsJKvCZ5cADBY+V' + 'LQNS0JBtMSTKSLaiuWoIJqCPaDRheWKQJh1NSnLqEcjyYANDxDCZlWzAYxWTZ2Uz7N7PbB0HY4DyPGKZYrfESVRbQcZNS6nNigPI9XhfGq6VjRe63ZaOaYpWrnOJqTRW' + 'jOKYujWdZ2BGO5lkuBAAkmcQkDmDBEAwEQJCgGhMGcQ4pkiSxGAAOYmkQIhvkYNg2gSCgyj+LI4GIMIwF2XQoAYAoAmASAWAaAZgggJgKFiT54DYDoDmECBGBKBJgGgT' + 'gWgWYRoFYGIGmGOBqByB5hCgegggiYJYgoJIICIaIeByChiigYgsgsYYYBYMIKCMKJOCuDRjGiOgLg6Y5InYPoPmQCAkmsXAQDQBCAg='); Add(3,'CP:2 -3 0 3 0'); end; set_Background(EXG2ANTTLib.BackgroundPartEnum.exShowFocusRect,$3010101); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; Chart.PaneWidth[True] := 1; with (Columns.Add('P1') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with Items do begin h := AddItem('Root'); InsertItem(h,Nil,'Child 1'); InsertItem(h,Nil,'Child 2'); ExpandItem[h] := True; end; EndUpdate(); end |
1960 |
The frame around the focusing item is not very clear. Can I show it larger or more cleared (sample 1)
with AxG2antt1 do begin BeginUpdate(); SingleSel := False; ShowFocusRect := True; with VisualAppearance do begin Add(1,'gBFLBCJwBAEHhEJAAEhABHoDg6AADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBIZQ7BKNIxjSJwFiCCQwSDKEjyCKcGRHF6MI6gOYpCgOIYjRJNIASVA' + 'ceAAGaUZrjSgobjmOYhAJCLqhYIgASXJqLaBlOCaAieSc+QhjQJIJoeCZXU5TFg1BTsOhqEqcRiseaRVDCaIJWzbdYWLDdNQHHKYLjnWorbpSJZ5XjNEySDQkMS9PrEJ' + '7vST8FBCdAABLJUB2BR9RwxRafKpnWwJDpmCaOQLXEB5DK1PyVMTKYrtGy7GrIAJxWxbV4UHh+QABOzIMAvHKJMwvHYcUZne5XVLeF41HbONogPaJZyIAK2cLROq6Xo7' + 'GEcJZEcLASB4DwvgWUZlE6AQQhKAYkkYdA6hyDIwHgSoqFwQgmnsYxjGgSIiBOTpSEiAwRgOJI7j4JAHA6U5wm0MpPlOBIjD8TZiGYCICiCGAuA6AxhAgMgSgOYQ4DYB' + 'g/g6cw1n+ABOmMMJ9DmCwjnScw4RsVJngkYh4hoKIKmKKI2CmC5ikiQgqgiT5jhyMw8g4QwIn0OIKEiCJhD8DwTGyfA7k0WQOEWEQkGkJhIhKZB5DYSoTiSCQEn4PQOC' + 'OXJcCeIJjliaIQk0aRyF4O5llmAhfhgZhJg4ZoYiaAxYn4PZOhOZJaCUZYTiYQw1mcOZUm+HQnHmWh4h6Z4pnYeYfk0eYsmqG4nAgNJ2DqD5DkCWoiGiOgqgyI5omoRo' + 'NiSaQKFKEojCaM4ugSFhOjkAJcieKgDkaH4oioGoOiaKRqgqEoqDddwyhuAxPgOMJ8DyDZqk6NYtCsapmjiLprHqdo6i+K5K1oPhOlqPgKD4DpjnII4yiOewuk6MxtAs' + 'MpSjObQ7EaT4wk6ewYn0PgPAiCJkjeLgDk6X44i4G4OmaORuguEpqDkLAzkaWg+E8GIUmaPIvEOVpzj2Lxbl6eo+G+S5in4OYPmOaJyjuTwjnYWpBg6DAjAqQZwkwJwN' + 'kKcJsEcEJCDBEpaD6Dw8BiapGjGSgfB2RpxmyBwgkicZ8haBw/g+M5TBcPQPlOXJskscp8jsMJMnMLJXDGTZzEyYw2kwMoDlcFw9i2M4/EGUJPg0CxFlENBtCcSJSnQf' + 'Q0m+SgPHsaJ7lALZLG6XZVHWDRfFqVY1k0ZxdladYTnifJUGaeAWAeMnSGcGWgBObJ3lWbwdjKW5cHcTZPHaLkN4GxXDlFqFsA4uRbBOGAFAEIzAsDEFOBkfYqR4D6AO' + 'BEYo8QuBvAmMceInBDgcD0JwOIqQyJ1DMAwG4IANDnHSMoK4QhOgMBGNEIQvQWAdGenETIswGiddsAAQAgCAgA=='); Add(2,'gBFLBCJwBAEHhEJAAEhABeEGACAADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADDFIBQSLAYROGSDJBGODJDjWGIeQLOEhQHI' + 'MRxPE6UYLhWYpBDKPYcUbGc7yBBMVwGf59XzACoKSheQIVSDQkw6Fo6NYhAxHALyNRkBy8f60KjtGpodDUJYvW5JYyjBZ8EznOqbJBkeJ7BgOe5NQjaD72VgdWQJFSWJ' + 'ajWYYJDOJY2ZAAE5TVINEwxJbDaylChIdxaF6WAzZEBhBYoATPNLBMrhWqKDw2XaQWBCOgwHYeR5LU7BdRwbIrRq2eAAXbcVyXfDddZlBK+QA0SK9lRVTKvJZmKgBWw1' + 'COSxmAAGw4kcNx1iKFBiCAfQsG8lJemucg7nsXpUHOOxrm+DI3jOH4XAOBx2nscw0j2HhPG4L5uGEVIECQCBCEUAYkGMHQHFGSBlGaAxkEgQgTGCVBsDYQhCgQJZrHKU' + 'ggGEShkFGNgIlsNpPnMHJHD+TADAIJIJiIWIeCqChikiIgmgiD5zHyXxgiACJKCuC4jHiZgtg6I4IlkCQwkwOIonMPJjEkFhGhGZBpA4KoMBCGJuEiE5lAkGg7hMY4JE' + 'YVoUCUNAOE6FZl0KWQACWOR2GKF5mBmChchkJRZhoXYaCKKYqGuDglEmNhuhWZpIiYc4dCcCRqGmHZlgm2YxAwSQKESHwkFkKgpiAIAIH4PIimOOg2DiChoiQJRRD+TZ' + 'DHCfwyAyCgyg+JpiioYJ/DgDgIlECQ6lwRAEICA='); Add(3,'CP:2 -2 0 2 0'); end; (GetOcx() as EXG2ANTTLib.G2antt).SelBackColor := $1000000; SelForeColor := Color.FromArgb(0,0,0); Chart.PaneWidth[True] := 1; set_Background(EXG2ANTTLib.BackgroundPartEnum.exShowFocusRect,$3ff0000); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('P1') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with Items do begin h := AddItem('Root'); InsertItem(h,Nil,'Child 1'); InsertItem(h,Nil,'Child 2'); ExpandItem[h] := True; end; EndUpdate(); end |
1959 |
How can I display the start/end margins of bars, when cursor hovers it like a tooltip
with AxG2antt1 do begin BeginUpdate(); Columns.Add('exBarToolTip'); with Chart do begin PaneWidth[False] := 96; FirstVisibleDate := '1/1/2001'; Bars.Item['Task'].Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := '<b><%=%9 + ''/'' + %C0%></b><br><upline><dotline>Start: <%=%1%><br>End: <%=%2%><br>Duration: <%=(%2-%1)%><br>Working: <%=%258%>'; end; with Items do begin AddBar(AddItem('Bar.Def'),'Task','1/2/2001','1/9/2001','K1',Nil); AddBar(AddItem('Bar.Def'),'Task','1/3/2001','1/10/2001','K1',Nil); h := AddItem('Items.ItemBar'); AddBar(h,'Unknown','1/4/2001','1/11/2001','K',Nil); ItemBar[h,'K',EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip] := 'Start:<%=%1%><br>End:<%=%2%>'; end; EndUpdate(); end |
1958 |
Is it possible to define different kinds of summary bars with using the EBN files
with AxG2antt1 do begin BeginUpdate(); with VisualAppearance do begin RenderType := -16777216; Add(1,'gBFLBCJwBAEHhEJAAEhABN0GACAADACAxRDAMgBQKAAzQFAYahuGSGAAGMYxQgmFgAQhFcZQSKUOQTDKMIziYBYJhEMQyDAAUIjOKsIhkGYcZAGQBJCjWGodQLOEgwHI' + 'ERQjEyUJAGGQIHhyPYbUbGUpQHKkeRtGqgBgoKhKEouNYgAbGYIwTRsdyfDSXBpEWwbDgkNQwWTDNoRDIUQStCysaYjOpnfrUAJ1P7FdQ1NJkXRhGSSK7maapaiCSZ6S' + 'TCMj1FhVKSNJ7DQKhGpgKh/ApgYpQOK4fLNXyRBK4QAyKA6bgPFZOZbFViaXY1V5bNKrcjhHQwAyHJ4XXRdV4YRAkUT4GqiJKGSYcQhuXZWbRqO6ABhef6DRThc6jKpF' + 'HIE4llEcojHqSZNgoIxnlgd5thsLREleL43gsYZ9BkaAYkMAgAm+CxGDWWAtiKCRfjcdRgHoHYnicUwgAIEIREAaQYkcQZUHIGRUDQJBOEYRAhDYCxGgMZAkCgdYQhaX' + 'QIAYERwQuahXggdgeG6VZ4H4IhdiIGIOB8YIiGiHZZgqYpGF4KYHiKCI+CAU5jCiTQ2g0YhEFyax4gABAEIC'); Add(2,'gBFLBCJwBAEHhEJAAEhABU0IQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRhGcTAJBMIhiGQYAChEZxVhEMgzDjIAxSJAcQRFESaAABGCQGh' + '+N4/S4NIi0CIsZQjCaiZ7pKA5bgMCo+UrNMixZQVCSOGChYRpCaZWpGGodQRUFbVHAlKypJKCKrEWSrDhuYAAW7XM7yBS1TzVNSuLZtaLqSroAJ1WTWMB0Ra8NzZEKfa' + 'ZACj4arKejrRDCMAggI='); end; Columns.Add('Task'); with Chart do begin PaneWidth[False] := 128; FirstVisibleDate := '1/1/2001'; with Bars.Item['Task'] do begin Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); Color := $1; end; with Bars.Item['Summary'] do begin Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); Color := $2000000; end; end; with Items do begin hSummaryJ := AddItem('Summary A'); AddBar(hSummaryJ,'Summary','1/2/2001','1/2/2001','J',Nil); hTaskJ := InsertItem(hSummaryJ,Nil,'Task A.1'); AddBar(hTaskJ,'Task','1/2/2001','1/5/2001','J1',Nil); hTaskJ := InsertItem(hSummaryJ,Nil,'Task A.2'); AddBar(hTaskJ,'Task','1/4/2001','1/8/2001','J2',Nil); DefineSummaryBars(hSummaryJ,'J',-1,'<*>'); hSummaryK := AddItem('Summary B'); AddBar(hSummaryK,'Summary','1/2/2001','1/2/2001','K',Nil); hTaskK := InsertItem(hSummaryK,Nil,'Task B.1'); AddBar(hTaskK,'Task','1/2/2001','1/5/2001','K1',Nil); hTaskK := InsertItem(hSummaryK,Nil,'Task B.2'); AddBar(hTaskK,'Task','1/4/2001','1/8/2001','K2',Nil); DefineSummaryBars(hSummaryK,'K',-1,'<*>'); ItemBar[0,'<K*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(255); hSummaryZ := AddItem('Summary B'); AddBar(hSummaryZ,'Summary','1/2/2001','1/2/2001','Z',Nil); hTaskZ := InsertItem(hSummaryZ,Nil,'Task B.1'); AddBar(hTaskZ,'Task','1/2/2001','1/5/2001','Z1',Nil); hTaskZ := InsertItem(hSummaryZ,Nil,'Task B.2'); AddBar(hTaskZ,'Task','1/4/2001','1/8/2001','Z2',Nil); DefineSummaryBars(hSummaryZ,'Z',-1,'<*>'); ItemBar[hSummaryZ,'Z',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(16842496); ItemBar[0,'<Z1>',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(50266112); ItemBar[0,'<Z2>',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(33554176); ExpandItem[0] := True; end; EndUpdate(); end |
1957 |
How can I display the week-number in ISO8601 format
with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 0; LevelCount := 2; FirstVisibleDate := '12/12/2007'; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exAllLines; UnitScale := EXG2ANTTLib.UnitEnum.exWeek; Level[0].FormatLabel := 'value + `<r><off -4><fgcolor=808080><font ;6>` + year(dvalue)'; Level[1].FormatLabel := '(value = 1 ? `<bgcolor=000000><fgcolor=FFFFFF>` : ``) + value'; WeekNumberAs := EXG2ANTTLib.WeekNumberAsEnum.exISO8601WeekNumber; FirstWeekDay := EXG2ANTTLib.WeekDayEnum.exMonday; end; EndUpdate(); end |
1956 |
I have a column right-aligned. How can I display its check box aligned to the right, as it appears to the left of the cell's caption
with AxG2antt1 do begin BeginUpdate(); ColumnAutoResize := True; Chart.PaneWidth[True] := 0; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exVLines; with Columns do begin with (Add('Left') as EXG2ANTTLib.Column) do begin AllowSizing := False; Width := 96; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); FormatColumn := '0 pos `A-Z`'; end; with (Add('Center') as EXG2ANTTLib.Column) do begin HeaderAlignment := EXG2ANTTLib.AlignmentEnum.CenterAlignment; Alignment := HeaderAlignment; AllowSizing := False; Width := 96; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); FormatColumn := '0 pos `A-Z`'; end; with (Add('Right') as EXG2ANTTLib.Column) do begin HeaderAlignment := EXG2ANTTLib.AlignmentEnum.RightAlignment; Alignment := HeaderAlignment; AllowSizing := False; Width := 96; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); FormatColumn := '0 pos `A-Z`'; Def[EXG2ANTTLib.DefColumnEnum.exCellDrawPartsOrder] := 'caption,check,icon,icons,picture'; end; Add(''); end; with Items do begin CellState[TObject(AddItem('Item 1')),TObject(3)] := 1; CellState[TObject(AddItem('Item 2')),TObject(2)] := 1; CellState[TObject(AddItem('Item 3')),TObject(1)] := 1; end; EndUpdate(); end |
1955 |
Can I display the column's multiple-lines caption vertically oriented (method 2)
with AxG2antt1 do begin BeginUpdate(); HeaderHeight := 48; ColumnAutoResize := True; Chart.PaneWidth[True] := 0; with Columns do begin Add('And others ...'); with (Add('') as EXG2ANTTLib.Column) do begin HTMLCaption := 'First Column'; HeaderVertical := True; Width := 36; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Def[EXG2ANTTLib.DefColumnEnum.exCellPaddingLeft] := TObject(8); Position := 0; end; with (Add('') as EXG2ANTTLib.Column) do begin HTMLCaption := '<c><b>Second Column'; HeaderVertical := True; Width := 36; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Def[EXG2ANTTLib.DefColumnEnum.exCellPaddingLeft] := TObject(8); Position := 1; end; with (Add('') as EXG2ANTTLib.Column) do begin HTMLCaption := '<r>Third Column'; HeaderVertical := True; Width := 36; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Def[EXG2ANTTLib.DefColumnEnum.exCellPaddingLeft] := TObject(8); Position := 2; end; end; with Items do begin CellState[TObject(AddItem('Item 1')),TObject(3)] := 1; CellState[TObject(AddItem('Item 2')),TObject(2)] := 1; CellState[TObject(AddItem('Item 3')),TObject(1)] := 1; end; EndUpdate(); end |
1954 |
Can I display the column's multiple-lines caption vertically oriented (method 1)
with AxG2antt1 do begin BeginUpdate(); HeaderHeight := 48; HeaderSingleLine := False; ColumnAutoResize := True; Chart.PaneWidth[True] := 0; with Columns do begin Add('And others ...'); with (Add('First Column') as EXG2ANTTLib.Column) do begin HeaderVertical := True; Width := 36; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Def[EXG2ANTTLib.DefColumnEnum.exCellPaddingLeft] := TObject(8); Position := 0; end; with (Add('Second Column') as EXG2ANTTLib.Column) do begin HeaderBold := True; HeaderVertical := True; Width := 36; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Def[EXG2ANTTLib.DefColumnEnum.exCellPaddingLeft] := TObject(8); Position := 1; end; with (Add('Third Column') as EXG2ANTTLib.Column) do begin HeaderVertical := True; Width := 36; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Def[EXG2ANTTLib.DefColumnEnum.exCellPaddingLeft] := TObject(8); Position := 2; end; end; with Items do begin CellState[TObject(AddItem('Item 1')),TObject(3)] := 1; CellState[TObject(AddItem('Item 2')),TObject(2)] := 1; CellState[TObject(AddItem('Item 3')),TObject(1)] := 1; end; EndUpdate(); end |
1953 |
Can I display the column's caption vertically oriented (method 2)
with AxG2antt1 do begin BeginUpdate(); HeaderHeight := 48; ColumnAutoResize := True; Chart.PaneWidth[True] := 0; with Columns do begin Add('And others ...'); with (Add('') as EXG2ANTTLib.Column) do begin HTMLCaption := 'First'; HeaderVertical := True; Width := 20; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Position := 0; end; with (Add('') as EXG2ANTTLib.Column) do begin HTMLCaption := '<c><b>Second'; HeaderVertical := True; Width := 20; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Position := 1; end; with (Add('') as EXG2ANTTLib.Column) do begin HTMLCaption := '<r>Third'; HeaderVertical := True; Width := 20; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Position := 2; end; end; with Items do begin CellState[TObject(AddItem('Item 1')),TObject(3)] := 1; CellState[TObject(AddItem('Item 2')),TObject(2)] := 1; CellState[TObject(AddItem('Item 3')),TObject(1)] := 1; end; EndUpdate(); end |
1952 |
Can I display the column's caption vertically oriented (method 1)
with AxG2antt1 do begin BeginUpdate(); HeaderHeight := 48; ColumnAutoResize := True; Chart.PaneWidth[True] := 0; with Columns do begin Add('And others ...'); with (Add('First') as EXG2ANTTLib.Column) do begin HeaderVertical := True; Width := 20; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Position := 0; end; with (Add('Second') as EXG2ANTTLib.Column) do begin HeaderBold := True; HeaderVertical := True; Width := 20; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Position := 1; end; with (Add('Third') as EXG2ANTTLib.Column) do begin HeaderVertical := True; Width := 20; AllowSizing := False; Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Position := 2; end; end; with Items do begin CellState[TObject(AddItem('Item 1')),TObject(3)] := 1; CellState[TObject(AddItem('Item 2')),TObject(2)] := 1; CellState[TObject(AddItem('Item 3')),TObject(1)] := 1; end; EndUpdate(); end |
1951 |
How can I resize all task-bars 0-length
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/3/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/5/2017',Nil,Nil); ItemBarEx['itembar(513) = 0 and itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(255); ItemBarEx['itembar(513) = 0 and itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarDuration] := 'value + 1'; end; EndUpdate(); end |
1950 |
Is it possible to mark items that holds items with 0-length (zero,empty, sample 3)
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with (Columns.Add('Duration') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty] := TObject(513); Visible := False; end; with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with ConditionalFormats.Add('%1 = 0',Nil) do begin Bold := True; BackColor := $bebebe; ChartBackColor := BackColor; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/3/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/5/2017',Nil,Nil); end; EndUpdate(); end |
1949 |
Is it possible to mark items that holds items with 0-length (zero,empty, sample 2)
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/3/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/5/2017',Nil,Nil); ItemBarEx['itembar(513) = 0',EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '`zero-length`'; end; EndUpdate(); end |
1948 |
Is it possible to mark items that holds items with 0-length (zero,empty, sample 1)
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/3/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/5/2017',Nil,Nil); ItemBarEx['itembar(513) = 0',EXG2ANTTLib.ItemBarPropertyEnum.exBarBackgroundExt] := '`[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]`'; ItemBarEx['itembar(513) = 0',EXG2ANTTLib.ItemBarPropertyEnum.exBarBackgroundExtInflate] := '`-4,-4,4,4`'; end; EndUpdate(); end |
1947 |
How can I find how many tasks/bars of 0-length (zero,empty) do I have
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/3/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/5/2017',Nil,Nil); OutputDebugString( ItemBarEx['itembar(513) = 0',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); end; EndUpdate(); end |
1946 |
How can I remove all bars from selected items
with AxG2antt1 do begin BeginUpdate(); SingleSel := False; Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; SelBackColor := $f0f0f0; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack; OverlaidGroup := 'Task,Task-Diff'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); end; with Bars.Copy('Task','Task-Diff') do begin Height := 4; Color := $ff; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(16); end; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); h := AddItem('Task 2'); AddBar(h,'Task','8/3/2017','8/9/2017',Nil,Nil); SelectItem[h] := True; h := AddItem('Task 3'); AddBar(h,'Task','8/4/2017','8/13/2017','',Nil); AddBar(h,'Task-Diff','8/5/2017','8/14/2017','P',Nil); SelectItem[h] := True; AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); OutputDebugString( 'Bars before remove: ' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); ItemBarEx['itemisselected',EXG2ANTTLib.ItemBarPropertyEnum.exBarKey] := '`toberemove` + value '; RemoveBar(0,'<toberemove*>'); OutputDebugString( 'Bars after remove: ' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); end; EndUpdate(); end |
1945 |
How can I remove task bars from selected items
with AxG2antt1 do begin BeginUpdate(); SingleSel := False; Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; SelBackColor := $f0f0f0; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack; OverlaidGroup := 'Task,Task-Diff'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); end; with Bars.Copy('Task','Task-Diff') do begin Height := 4; Color := $ff; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(16); end; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); h := AddItem('Task 2'); AddBar(h,'Task','8/3/2017','8/9/2017',Nil,Nil); SelectItem[h] := True; h := AddItem('Task 3'); AddBar(h,'Task','8/4/2017','8/13/2017','',Nil); AddBar(h,'Task-Diff','8/5/2017','8/14/2017','P',Nil); SelectItem[h] := True; AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); OutputDebugString( 'Bars before remove: ' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); ItemBarEx['itemisselected and itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarKey] := '`toberemove` + value '; RemoveBar(0,'<toberemove*>'); OutputDebugString( 'Bars after remove: ' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); end; EndUpdate(); end |
1944 |
How can I change the pattern for some bars only
with AxG2antt1 do begin BeginUpdate(); (Columns.Add('Tasks') as EXG2ANTTLib.Column).Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); h := AddItem('Task 2'); AddBar(h,'Task','8/3/2017','8/9/2017',Nil,Nil); CellState[TObject(h),TObject(0)] := 1; h := AddItem('Task 3'); AddBar(h,'Task','8/4/2017','8/13/2017',Nil,Nil); CellState[TObject(h),TObject(0)] := 1; AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx['cellstate(0)',EXG2ANTTLib.ItemBarPropertyEnum.exBarPattern] := TObject(6); end; EndUpdate(); end |
1943 |
How do I apply the same effort to all bars
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; HistogramView := EXG2ANTTLib.HistogramViewEnum.exHistogramAllItems; HistogramVisible := True; HistogramHeight := 64; with Bars.Item['Task'] do begin HistogramPattern := EXG2ANTTLib.PatternEnum.exPatternBDiagonal; HistogramType := EXG2ANTTLib.HistogramTypeEnum.exHistOverAllocation; end; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarEffort] := TObject(2); end; EndUpdate(); end |
1942 |
How do I apply the same percent to all bars
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Add('Task%Progress') do begin Shortcut := 'Task'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarShowPercentCaption] := TObject(True); end; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarPercent] := TObject(0.5); end; EndUpdate(); end |
1941 |
How can I set the same duration for all bars
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarDuration] := TObject(4); end; EndUpdate(); end |
1940 |
How do I move all bars to end at the same date-time
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarMoveEnd] := '#8/15/2017#'; end; EndUpdate(); end |
1939 |
How do I move all bars to start at the same date-time
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarMoveStart] := '#8/2/2017#'; end; EndUpdate(); end |
1938 |
How do I apply a new color for some bars, while others should be shown with a different color
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; SelBackColor := $f0f0f0; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack; OverlaidGroup := 'Task,Task-Diff'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); end; with Bars.Copy('Task','Task-Diff') do begin Height := 4; Color := $ff; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(16); end; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); h := AddItem('Task 3'); AddBar(h,'Task','8/4/2017','8/13/2017','',Nil); AddBar(h,'Task-Diff','8/5/2017','8/14/2017','P',Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := 'cellcaption(0) like `*2` ? 0x0000FF : 0x00FF00'; end; EndUpdate(); end |
1937 |
How do I hide some bars, and show others
with AxG2antt1 do begin BeginUpdate(); SingleSel := False; Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; SelBackColor := $f0f0f0; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack; OverlaidGroup := 'Task,Task-Diff'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(18); end; with Bars.Copy('Task','Task-Diff') do begin Height := 4; Color := $ff; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '<font ;6><%=%0%>'; Def[EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption] := TObject(16); end; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); h := AddItem('Task 2'); AddBar(h,'Task','8/3/2017','8/9/2017',Nil,Nil); SelectItem[h] := True; h := AddItem('Task 3'); AddBar(h,'Task','8/4/2017','8/13/2017','',Nil); AddBar(h,'Task-Diff','8/5/2017','8/14/2017','P',Nil); SelectItem[h] := True; AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); ItemBarEx['-1',EXG2ANTTLib.ItemBarPropertyEnum.exBarTransparent] := 'itembar(0) = `Task` ? 0 : 100'; end; EndUpdate(); end |
1936 |
I like how ItemBarEx works, the question is how can I remove the bars based on the same criteria
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; end; with Items do begin AddBar(AddItem('Task 1'),'Task','8/2/2017','8/6/2017',Nil,Nil); AddBar(AddItem('Task 2'),'Task','8/3/2017','8/9/2017',Nil,Nil); AddBar(AddItem('Task 3'),'Task','8/4/2017','8/13/2017',Nil,Nil); AddBar(AddItem('Task 4'),'Task','8/5/2017','8/16/2017',Nil,Nil); OutputDebugString( 'Bars before remove: ' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); ItemBarEx['cellcaption(0) like `*2 *3`',EXG2ANTTLib.ItemBarPropertyEnum.exBarKey] := '`toberemove` + value '; RemoveBar(0,'<toberemove*>'); OutputDebugString( 'Bars after remove: ' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); end; EndUpdate(); end |
1935 |
Is it possible to automatically color the bar being checked
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin end; with AxG2antt1 do begin BeginUpdate(); SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; with Chart do begin LevelCount := 2; PaneWidth[False] := 256; FirstVisibleDate := '1/1/2017'; end; with ConditionalFormats.Add('%CS0','check') do begin Bold := True; ApplyToBars := 'Task'; BarColor := $10000; end; with (Columns.Add('Items') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); Width := 256; end; (Columns.Add(AxG2antt1.ConditionalFormats.Item['check'].Expression) as EXG2ANTTLib.Column).FormatColumn := AxG2antt1.ConditionalFormats.Item['check'].Expression; with Items do begin AddBar(AddItem('Item 1'),'Task','1/2/2017','1/12/2017',Nil,Nil); h := AddItem('Item 2'); AddBar(h,'Task','1/3/2017','1/13/2017',Nil,Nil); CellState[TObject(h),TObject(0)] := 1; h := AddItem('Item 3'); AddBar(h,'Task','1/4/2017','1/14/2017',Nil,Nil); CellState[TObject(h),TObject(0)] := 1; end; EndUpdate(); end |
1934 |
How do I automatically bold items being checked
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin end; with AxG2antt1 do begin BeginUpdate(); SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; Chart.PaneWidth[True] := 0; with ConditionalFormats.Add('%CS0','check') do begin Bold := True; end; (Columns.Add('Items') as EXG2ANTTLib.Column).Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); (Columns.Add(AxG2antt1.ConditionalFormats.Item['check'].Expression) as EXG2ANTTLib.Column).FormatColumn := AxG2antt1.ConditionalFormats.Item['check'].Expression; with Items do begin AddItem('Item 1'); CellState[TObject(AddItem('Item 2')),TObject(0)] := 1; AddItem('Item 3'); end; EndUpdate(); end |
1933 |
Can I display the radio-button with a solid color
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; set_RadioImage(False,32699122); set_RadioImage(True,16777216); (Columns.Add('Check') as EXG2ANTTLib.Column).Def[EXG2ANTTLib.DefColumnEnum.exCellHasRadioButton] := TObject(True); with Items do begin AddItem('Radio 1'); CellState[TObject(AddItem('Radio 2')),TObject(0)] := 1; AddItem('Radio 1'); end; EndUpdate(); end |
1932 |
Can I display the check-box with a solid color
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; set_CheckImage(EXG2ANTTLib.CheckStateEnum.Unchecked,32699122); set_CheckImage(EXG2ANTTLib.CheckStateEnum.Checked,16777216); (Columns.Add('Check') as EXG2ANTTLib.Column).Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); with Items do begin AddItem('Check 1'); CellState[TObject(AddItem('Check 2')),TObject(0)] := 1; AddItem('Check 3'); end; EndUpdate(); end |
1931 |
How can I use the CellState with ConditionalFormat/ComputedField/FormatColumn
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exGroupLinesInsideLeaf; SelBackMode := EXG2ANTTLib.BackModeEnum.exTransparent; Chart.PaneWidth[True] := 0; with (Columns.Add('Items') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; with (Columns.Add('Format') as EXG2ANTTLib.Column) do begin FormatColumn := '%CS0'; Caption := FormatColumn; Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor] := TObject(8421504); Def[EXG2ANTTLib.DefColumnEnum.exHeaderForeColor] := Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor]; end; with Items do begin h := AddItem('Root'); InsertItem(h,Nil,'Item 1'); CellState[TObject(InsertItem(h,Nil,'Item 2')),TObject(0)] := 1; CellState[TObject(InsertItem(h,Nil,'Item 3')),TObject(0)] := 1; ExpandItem[h] := True; end; EndUpdate(); end |
1930 |
How can I use the CellData with ConditionalFormat/ComputedField/FormatColumn
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; Columns.Add('Items'); with (Columns.Add('Format') as EXG2ANTTLib.Column) do begin FormatColumn := '%CD0'; Caption := FormatColumn; Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor] := TObject(8421504); Def[EXG2ANTTLib.DefColumnEnum.exHeaderForeColor] := Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor]; end; with Items do begin CellData[TObject(AddItem('Item 1')),TObject(0)] := TObject(1234); CellData[TObject(AddItem('Item 2')),TObject(0)] := 'this is just an user data'; CellData[TObject(AddItem('Item 3')),TObject(0)] := '1/1/2001'; end; EndUpdate(); end |
1929 |
How can I use the CellValue/CellCaption with ConditionalFormat/ComputedField/FormatColumn
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; with (Columns.Add('Items') as EXG2ANTTLib.Column) do begin with Editor do begin EditType := EXG2ANTTLib.EditTypeEnum.DropDownListType; AddItem(1,'Item 1',Nil); AddItem(2,'Item 2',Nil); AddItem(3,'Item 3',Nil); end; end; with (Columns.Add('Format') as EXG2ANTTLib.Column) do begin FormatColumn := '%0'; Caption := FormatColumn; Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor] := TObject(8421504); Def[EXG2ANTTLib.DefColumnEnum.exHeaderForeColor] := Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor]; AllowSizing := False; end; with (Columns.Add('Format') as EXG2ANTTLib.Column) do begin FormatColumn := '%C0'; Caption := FormatColumn; Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor] := TObject(8421504); Def[EXG2ANTTLib.DefColumnEnum.exHeaderForeColor] := Def[EXG2ANTTLib.DefColumnEnum.exCellForeColor]; AllowSizing := False; end; with Items do begin AddItem(TObject(1)); CellValue[TObject(AddItem(TObject(0))),TObject(0)] := TObject(2); AddItem(TObject(2)); end; EndUpdate(); end |
1928 |
How can I use the ShowNonworkingHours property (hide the non-working hours)
with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 0; LevelCount := 2; UnitScale := EXG2ANTTLib.UnitEnum.exHour; NonworkingHours := 16253183; ShowNonworkingHours := False; ShowNonworkingUnits := False; end; EndUpdate(); end |
1927 |
How can I use the ShowNonworkingDates property (hide the non-working days)
with AxG2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 0; LevelCount := 2; UnitScale := EXG2ANTTLib.UnitEnum.exDay; ShowNonworkingDates := False; ShowNonworkingUnits := False; end; EndUpdate(); end |
1926 |
How can I show/hide bars once the user checks or un-checks a column
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin with Items do begin ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarTransparent] := 'cellstate(0) = 1 ? 0 : 100'; end; end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarTransparent] := 'cellstate(0) = 1 ? 0 : 100'; end; EndUpdate(); end |
1925 |
How can I change the color for all Task bars
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(65280); end; EndUpdate(); end |
1924 |
Is it possible to automatically select bars only when user selects a new item
// SelectionChanged event - Fired after a new item has been selected. procedure TWinForm1.AxG2antt1_SelectionChanged(sender: System.Object; e: System.EventArgs); begin with AxG2antt1 do begin with Items do begin ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected] := 'itemisselected'; end; end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; Columns.Add('Tasks'); HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin AllowSelectObjects := EXG2ANTTLib.SelectObjectsEnum.exNoSelectObjects; FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1923 |
Is it possible to automatically select bars only when the user clicks the column's checkbox
// CellStateChanged event - Fired after cell's state has been changed. procedure TWinForm1.AxG2antt1_CellStateChanged(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_CellStateChangedEvent); begin with AxG2antt1 do begin with Items do begin ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected] := 'cellstate(0) = 1'; end; end end; with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin AllowSelectObjects := EXG2ANTTLib.SelectObjectsEnum.exNoSelectObjects; FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; end; EndUpdate(); end |
1922 |
How do I select all bars on leaf items
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['itemlevel = 1',EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected] := TObject(True); end; EndUpdate(); end |
1921 |
How can I change the caption for all checked Task bars
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['(cellstate(0) = 1) and (itembar(0) = `Task`)',EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '`new caption`'; end; EndUpdate(); end |
1920 |
How can I change the caption for all Task bars
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['(itembar(0) = `Task`)',EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '`new caption`'; end; EndUpdate(); end |
1919 |
How can I change the caption for all bars
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption] := '`new caption`'; end; EndUpdate(); end |
1918 |
How can I move all Task bars to end at the same date time
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['(itembar(0) = `Task`)',EXG2ANTTLib.ItemBarPropertyEnum.exBarMove] := '#8/14/2017# - itembar(2)'; end; EndUpdate(); end |
1917 |
How can I move all Task bars to start at the same date time
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['(itembar(0) = `Task`)',EXG2ANTTLib.ItemBarPropertyEnum.exBarMove] := '#8/3/2017# - itembar(1)'; end; EndUpdate(); end |
1916 |
How can I change the color for checked Task bars
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['cellstate(0) = 1 and itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarColor] := TObject(255); end; EndUpdate(); end |
1915 |
How do I resize all Task bars programatically
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarEnd] := 'value + 2'; end; EndUpdate(); end |
1914 |
How do I move just the checked Task bars in the chart
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['cellstate(0) = 1 and itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarMove] := TObject(-2); end; EndUpdate(); end |
1913 |
How do I move all Task bars in the chart
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarMove] := TObject(1); end; EndUpdate(); end |
1912 |
How do I count all Task bars in the chart
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; Columns.Add('Tasks'); HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; OutputDebugString( ItemBarEx['itembar(0) = `Task`',EXG2ANTTLib.ItemBarPropertyEnum.exBarsCount] ); end; EndUpdate(); end |
1911 |
How do I select bars whose items are checked
with AxG2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot; with (Columns.Add('Tasks') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True); PartialCheck := True; end; HeaderVisible := EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels; SelBackColor := Color.FromArgb(240,240,240); SelForeColor := Color.FromArgb(0,0,0); with Chart do begin FirstVisibleDate := '8/1/2017'; LevelCount := 2; PaneWidth[False] := 128; with Bars.Item['Summary'] do begin StartShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; EndShape := EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty; Shape := EXG2ANTTLib.ShapeBarEnum.exShapeThinDown; end; SelBackColor := AxG2antt1.SelBackColor; SelBarColor := $808080; end; with Items do begin h := AddItem('Project'); hChild := InsertItem(h,Nil,'Task 1'); AddBar(hChild,'Task','8/2/2017','8/8/2017',Nil,Nil); SelectItem[hChild] := True; hChild := InsertItem(h,Nil,'Task 2'); AddBar(hChild,'Task','8/3/2017','8/10/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; hChild := InsertItem(h,Nil,'Task 3'); AddBar(hChild,'Task','8/4/2017','8/12/2017',Nil,Nil); CellState[TObject(hChild),TObject(0)] := 1; AddBar(h,'Summary','8/1/2017','8/1/2017','sum',Nil); DefineSummaryBars(h,'sum',-3,''); ExpandItem[h] := True; ItemBarEx['cellstate(0) = 1',EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected] := TObject(True); end; EndUpdate(); end |
1910 |
How can I select all bars, where a specified column matches a specified criteria
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Task'); Chart.FirstVisibleDate := '1/1/2001'; Chart.PaneWidth[False] := 48; Chart.SelBarColor := $ff; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(h,'Task','1/5/2001','1/7/2001','K2','K2'); AddBar(h,'Task','1/8/2001','1/10/2001','P','P'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','Q','Q'); AddBar(AddItem('Task 4'),'Task','1/2/2001','1/4/2001','M','M'); ItemBarEx['cellcaption(0) = `Task 1`',EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected] := TObject(True); end; EndUpdate(); end |
1909 |
How can I select/unselect all bars
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Task'); Chart.FirstVisibleDate := '1/1/2001'; Chart.PaneWidth[False] := 48; Chart.SelBarColor := $ff; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(h,'Task','1/5/2001','1/7/2001','K2','K2'); AddBar(h,'Task','1/8/2001','1/10/2001','P','P'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','Q','Q'); AddBar(AddItem('Task 4'),'Task','1/2/2001','1/4/2001','M','M'); ItemBarEx[TObject(True),EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected] := TObject(True); end; EndUpdate(); end |
1908 |
Is it possible to set the background color of the chart for one item and one day
with AxG2antt1 do begin BeginUpdate(); Columns.Add('Items'); with Chart do begin LevelCount := 2; PaneWidth[False] := 96; FirstVisibleDate := '1/1/2001'; end; with Items do begin AddItem('Item'); h := AddItem('Item'); AddBar(h,'','1/2/2001','1/3/2001','Back',' '); ItemBar[h,'Back',EXG2ANTTLib.ItemBarPropertyEnum.exBarBackColor] := TObject(255); ItemBar[h,'Back',EXG2ANTTLib.ItemBarPropertyEnum.exBarSelectable] := TObject(False); AddItem('Item'); end; EndUpdate(); end |
1907 |
It is possible to search for an item ( inside the Editor ), case insensitive
with AxG2antt1 do begin BeginUpdate(); with (Columns.Add('DropDownList') as EXG2ANTTLib.Column).Editor do begin EditType := EXG2ANTTLib.EditTypeEnum.DropDownListType; AddItem(1,'One',Nil); AddItem(2,'Two',Nil); AddItem(3,'Three',Nil); end; with Items do begin AddItem(AxG2antt1.Columns.Item[TObject(0)].Editor.FindItem['>ONE']); AddItem(AxG2antt1.Columns.Item[TObject(0)].Editor.FindItem['>ThRee']); AddItem(AxG2antt1.Columns.Item[TObject(0)].Editor.FindItem['ONE']); AddItem(AxG2antt1.Columns.Item[TObject(0)].Editor.FindItem['>tWo']); end; EndUpdate(); end |
1906 |
The text after the BR-tag is in same line as the text before the BR-tag (entire column)
with AxG2antt1 do begin BeginUpdate(); DrawGridLines := EXG2ANTTLib.GridLinesEnum.exHLines; Chart.PaneWidth[True] := 0; with (Columns.Add('Default') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellValueFormat] := TObject(1); Def[EXG2ANTTLib.DefColumnEnum.exCellSingleLine] := TObject(False); end; with Items do begin AddItem('This is the first line.<br>This is the second line.'); AddItem('This is the first line.<br>This is the second line.'); AddItem('This is the first line.<br>This is the second line.'); end; EndUpdate(); end |
1905 |
The text after the BR-tag is in same line as the text before the BR-tag (individual)
with AxG2antt1 do begin BeginUpdate(); DrawGridLines := EXG2ANTTLib.GridLinesEnum.exHLines; Chart.PaneWidth[True] := 0; Columns.Add('Default'); with Items do begin CellValueFormat[TObject(AddItem('This is the first line.<br>This is the second line.')),TObject(0)] := EXG2ANTTLib.ValueFormatEnum.exHTML; h := AddItem('<b>This is the first line.<br>This is the second line.</b>'); CellValueFormat[TObject(h),TObject(0)] := EXG2ANTTLib.ValueFormatEnum.exHTML; CellSingleLine[TObject(h),TObject(0)] := EXG2ANTTLib.CellSingleLineEnum.exCaptionWordWrap; CellValueFormat[TObject(AddItem('This is the first line.<br>This is the second line.')),TObject(0)] := EXG2ANTTLib.ValueFormatEnum.exHTML; end; EndUpdate(); end |
1904 |
How do I prevent showing the control's BackColorAlternate property on empty / non-items part of the control
with AxG2antt1 do begin BeginUpdate(); DrawGridLines := EXG2ANTTLib.GridLinesEnum.exAllLines; with Chart do begin DrawGridLines := EXG2ANTTLib.GridLinesEnum.exAllLines; LevelCount := 2; PaneWidth[False] := 128; FirstVisibleDate := '1/1/2001'; end; (GetOcx() as EXG2ANTTLib.G2antt).BackColorAlternate := $7ff0f0f0; BackColorLevelHeader := BackColor; Columns.Add('Column'); with Items do begin AddBar(AddItem('Item 1'),'Task','1/2/2001','1/12/2001',Nil,Nil); AddBar(AddItem('Item 2'),'Task','1/3/2001','1/13/2001',Nil,Nil); AddBar(AddItem('Item 3'),'Task','1/2/2001','1/12/2001',Nil,Nil); AddBar(AddItem('Item 4'),'Task','1/3/2001','1/13/2001',Nil,Nil); AddBar(AddItem('Item 5'),'Task','1/2/2001','1/12/2001',Nil,Nil); end; EndUpdate(); end |
1903 |
Can I disable an item once the user selects a new value into a different item
// Change event - Occurs when the user changes the cell's content. procedure TWinForm1.AxG2antt1_Change(sender: System.Object; e: AxEXG2ANTTLib._IG2anttEvents_ChangeEvent); begin with AxG2antt1 do begin with Items do begin EnableItem[ItemByIndex[1]] := False; end; end end; with AxG2antt1 do begin FreezeEvents(True); BeginUpdate(); Chart.PaneWidth[True] := 0; ScrollBySingleLine := True; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exRowLines; Columns.Add('Q'); Columns.Add('A'); with Items do begin h1 := AddItem('What''s your gender?'); with CellEditor[TObject(h1),TObject(1)] do begin EditType := EXG2ANTTLib.EditTypeEnum.DropDownListType; AddItem(1,'Male',Nil); AddItem(0,'Female',Nil); end; CellValue[TObject(h1),TObject(1)] := TObject(1); h2 := AddItem('What''s pet name?'); CellValue[TObject(h2),TObject(1)] := 'This is my pet favorite long long long name, that shoul break the line in multiple pieces'; CellSingleLine[TObject(h2),TObject(1)] := EXG2ANTTLib.CellSingleLineEnum.exCaptionWordWrap; end; EndUpdate(); FreezeEvents(False); end |
1902 |
How can I get a row expanded / enlarged to fit the cell's text (entire column)
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; ScrollBySingleLine := True; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exRowLines; Columns.Add('Q'); with (Columns.Add('A') as EXG2ANTTLib.Column) do begin Def[EXG2ANTTLib.DefColumnEnum.exCellSingleLine] := TObject(False); with Editor do begin EditType := EXG2ANTTLib.EditTypeEnum.MemoType; Appearance := EXG2ANTTLib.InplaceAppearanceEnum.SingleApp; end; end; with Items do begin h1 := AddItem('What''s name?'); CellValue[TObject(h1),TObject(1)] := 'This is my pet favorite long long long name, that shoul break the line in multiple pieces'; h2 := AddItem('What''s your pet name?'); CellValue[TObject(h2),TObject(1)] := 'This is my pet favorite long long long name, that shoul break the line in multiple pieces'; end; EndUpdate(); end |
1901 |
How can I get a row expanded / enlarged to fit the cell's text (individual cell)
with AxG2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; ScrollBySingleLine := True; DrawGridLines := EXG2ANTTLib.GridLinesEnum.exRowLines; Columns.Add('Q'); Columns.Add('A'); with Items do begin h1 := AddItem('What''s name?'); CellValue[TObject(h1),TObject(1)] := 'This is my pet favorite long long long name, that shoul break the line in multiple pieces'; h2 := AddItem('What''s your pet name?'); with CellEditor[TObject(h2),TObject(1)] do begin EditType := EXG2ANTTLib.EditTypeEnum.MemoType; Appearance := EXG2ANTTLib.InplaceAppearanceEnum.SingleApp; end; CellValue[TObject(h2),TObject(1)] := 'This is my pet favorite long long long name, that shoul break the line in multiple pieces'; CellSingleLine[TObject(h2),TObject(1)] := EXG2ANTTLib.CellSingleLineEnum.exCaptionWordWrap; end; EndUpdate(); end |